#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
脚本测试
@Time    : 2019-12-05 10:16
@Author  : wangb
@Email   : joker_wb@163.com
@File    : request_test.py
@Software: PyCharm
"""
import requests
import json

headers = {
    "license": "e10adc3949ba59abbe56e057f20f883e"
}
COMMIT_MESSAGE_URL = "http://127.0.0.1:8080/smart/message/commitMessage"
# response = requests.get('http://127.0.0.1:5000/config', headers=headers)
response = requests.post('http://127.0.0.1:8080/smart/duty/getRtsp?type=1', headers=headers)
request_result = json.loads(response.content)
print(request_result)

results_data = {
    "type": "1",
    "staff_num": "11",
    # "image_url": IMG_URL + remote_img_url,  # 临时使用
    "image_url": "test",  # 临时使用
    "record_time": "2018-05-20 20:20:30"
}


requests_results = requests.post(COMMIT_MESSAGE_URL,
                                         data=json.dumps(results_data),
                                         headers=headers, timeout=3.5)

print(requests_results.content)
